<%@ page contentType="text/html;charset=UTF-8"%>
<%@ page import="org.springside.modules.security.springsecurity.SpringSecurityUtils" %>
<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>安全防护管理系统  角色管理</title>
	<%@ include file="/common/meta.jsp"%>
	<link href="${ctx}/css/qtable.css" type="text/css" rel="stylesheet">
	<link href="${ctx}/css/default.css" type="text/css" rel="stylesheet">
</head>

<body>
<div id="menu">
<h3>
	<a href="${ctx}/security/user.action">帐号列表</a>
	<a href="${ctx}/security/role.action">角色列表</a> 
	<a href="${ctx}/j_spring_security_logout">退出登录</a>
</h3>
</div>

<div id="message"><s:actionmessage theme="mytheme"/></div>

<div id="filter">你好,<%=SpringSecurityUtils.getCurrentUserName()%>.</div>

<div id="qtableContent">
<table id="qtable">
	<tr>
		<th><b>角色名称</b></th>
		<th><b>角色描述</b></th>
		<th><b>操作</b></th>
	</tr>

	<s:iterator value="allRoles">
		<tr>
			<td width="25%">${name}</td>
			<td width="50%">${desc}</td>
			<td width="25%">&nbsp; 
				<security:authorize ifAnyGranted="A_MODIFY_ROLE">
					<a href="role!input.action?id=${id}">修改</a>&nbsp;
					<a href="role!delete.action?id=${id}">删除</a>&nbsp;
					<a href="role!authRole.action?id=${id}">授权</a>&nbsp;
				</security:authorize>
			</td>
		</tr>
	</s:iterator>
</table>
</div>

<div id="qtableFooter">
	<security:authorize ifAnyGranted="A_MODIFY_ROLE">
		<a href="role!input.action">增加新角色</a>
	</security:authorize>
</div>

</body>
</html>